package arrayandlinkedlist

func climbStairs(n int) int {
	if n == 1 {
		return 1
	}
	if n == 2 {
		return 2
	}

	a, b, current := 1, 2, 0
	// go没有前置的++i
	for i := 3; i <= n; i++ {
		current = a + b
		a = b
		b = current
	}
	return current
}
